<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>检阅问答题</title>
    <link rel="stylesheet" href="/lims/layui/css/layui.css?20190817.1">
    <link href="/css/exam/main.css" rel="stylesheet" type="text/css" />
    <link href="/css/exam/iconfont.css" rel="stylesheet" type="text/css" />
    <link href="/css/exam/test.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="/lims/layui/css/layui.css?20190817.1">
    <style>
        .hasBeenAnswer {
            background: #5d9cec;
            color:#fff;
        }
        .nr_left,.test_title{
            width:100%;
        }
        .test_content_nr{
            border-top:none;
        }
        .test_content_nr>ul>li{
            padding-bottom:10px;
            border-bottom:1px solid #efefef;
        }
        .test_content_nr_tt {
            border-bottom:none;
        }
        .test{
            border-bottom:none;
        }
        .layui-layer-title{
            text-align: left;
        }
    </style>

</head>
<body>
<div class="main">
    <!--nr start-->
    <div class="test_main">
        <div class="nr_left">
            <div class="test">
                <form action="" method="post">
                    <div class="test_title" style="    width: 78%;">

                        <font><input type="button" name="test_jiaojuan"id="jiaojuan"  value="提交"></font>
                    </div>



                    <div class="test_content">
                        <div class="test_content_title">
                            <h2>客观题</h2>
                            <%--<p>--%>
                            <%--<span>共</span><i class="content_lit">30</i><span>题，</span><span>合计</span><i class="content_fs">30</i><span>分</span>--%>
                            <%--</p>--%>
                        </div>
                    </div>
                    <div class="test_content_nr list5">
                        <ul>

                            <%--                            <li id="qu_4_0">--%>
                            <%--                                <div class="test_content_nr_tt">--%>
                            <%--                                    <i>1</i><span>(1分)</span><font>以下属于南方电网员工职业操守中明文规定的有</font><b class="icon iconfont"></b>--%>
                            <%--                                </div>--%>
                            <%--                            </li>--%>


                        </ul>
                    </div>

                </form>
            </div>

        </div>

    </div>
    <!--nr end-->
    <div class="foot"></div>
</div>

<script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
<script src="/js/exam/jquery.easy-pie-chart.js"></script>
<!--时间js-->
<script src="/js/exam/jquery.countdown.js?20191203"></script>
<script type="text/javascript" src="/lib/layer/layer.js?20201106"></script>
<script type="text/javascript" src="/js/base/base.js"></script>
<script>

    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    }
    var zmarr=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R'];
    var zmIndex=0;
    var scoreId=GetQueryString('scoreId');
    var oneArr=[];
    var twoArr=[];
    var threeArr=[];
    var fourArr=[];
    var fiveArr=[];
    $(function() {
        $.ajax({
            url:'/exaExamination/selQuestion5',
            data:{
                scoreId:scoreId,
                type:1
            },
            asycn:false,
            dataType:'json',
            type:'get',
            success:function (res) {
                var data=res.object
                $('.grade').html(data.countScores);

                //难度类型（1-简单 2-中等 3-困难）


                //客观题
                var list5='';
                var answer5='';
                for(var i=0;i<res.object.list5.length;i++) {
                    var data = res.object.list5;
                    list5+='<li id="qu_4_'+[i]+'"  class="fiveUl">'+
                        '<div class="test_content_nr_tt">'+
                        ' <i>' + [i+1] + '</i><span>('+[data[i].scoreNum]+'分)</span><font>' + data[i].exaQuestions.eqSubject + '</font><br/>'+

                        '<textarea style="width: 800px;height: 100px" class="five answer4'+[i]+'" value="'+data[i].answer+'" eqId='+data[i].exaQuestions.eqId+' score='+data[i].exaQuestions.score+' id="4_answer_'+[i+1]+'_option_1" >'+data[i].answer+'</textarea>'+
                        '<div>正确答案：'+data[i].exaQuestions.answer+'</div>'+
                        '<div>得分：<input type="text" class="scoreNum" style="width: 50px;height: 30px;">分</div>'+
                        ' </div>'+
                        '</li>';
                    // answer5+='<li><a href="#qu_4_'+[i]+'">'+[i+1]+'</a></li>';
                }
                $('.list5 ul').html(list5)
                $('.answer5 ul').html(answer5)


            }
        })
    });

    $('#jiaojuan').click(function(){
        // layer.open({
        //     type:1,
        //     btn: ['确定', ' 取消'], //按钮
        //
        // })
        layer.confirm('确认要提交吗？', {
            btn: ['确定', ' 取消'], //按钮
            title: "提交"
        }, function(){
            var num =0;
            for(var i=0;i<$('.scoreNum').length;i++){
                if($('.scoreNum').eq(i).val()==''){
                    layer.msg('请输入分数',{icon:2});
                    return false
                }else{
                    num += Number($('.scoreNum').eq(i).val())
                }
            }
            $.ajax({
                url:'/exaExamination/reviewQuestion',
                data:{
                    scoreId:scoreId,
                    score:num
                },
                dataType:'json',
                success:function(res){
                    if(res.code == 0){
                        layer.msg('提交成功',{icon:1});
                        window.opener.location.reload();
                        window.close();
                    }
                }
            })
        }, function(){
            layer.closeAll();
        });
    })



</script>

</body>
</html>
